function* fibGen() {
  let [a, b] = [0, 1]
  while (true) {
    [a, b] = [b, a + b]
    yield a
  }
  return "done"
}

const g = fibGen()

// g.next() -> { value: 1, done: false }
console.log(g.next())
console.log(g.next())
console.log(g.next())
console.log(g.next())
console.log(g.next())
console.log(g.next())
console.log(g.next())
console.log(g.next())